
<?php include_once(dirname(__FILE__) . '/../general/head.php'); ?>

<!-- header -->
<?php include_once(dirname(__FILE__) . '/../general/header.php'); ?>

<?php include_once('left.php'); ?>


<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">Thay đổi cách xếp loại</h1>
        </div>
    </div>

    <?php
    if ($editResult) {
        ?>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-success">
                    <div class="panel-heading">
                        <?php echo $editResult; ?>
                    </div>
                </div>
            </div>
        </div>
    <?php } ?>

    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    Bảng điều kiện xếp loại
                </div>
                <div class="panel-body">
                    <form method="post" action="<?php echo site_url(get_folder($loggedUser['title']).'/final_ratings/edit/'); ?>">
                        <input type="hidden" name="Command" value="Edit" />

                        <?php if ($finalRatings == false) { ?>
                            Hiện tại không có giá trị đánh giá nào!
                            <br>
                        <?php } else { ?>
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="final-ratings">
                                    <thead>
                                        <tr>
                                            <th>&nbsp;</th>
                                            <?php
                                            foreach ($firstRatings as $each) {
                                                ?>
                                                <th><?php echo $each['name']; ?></th>
                                            <?php } ?> 
                                        </tr>
                                    </thead>
                                    <tbody>


                                        <?php
                                        $i = 0;
                                        foreach ($attRatings as $each) {
                                            ?>
                                            <tr>
                                                <td><?php echo $each['name']; ?></td>

                                                <td><?php echo $finalRatings[$i]['name']; ?></td>
                                                <td><?php echo $finalRatings[$i + 1]['name']; ?></td>
                                                <td><?php echo $finalRatings[$i + 2]['name']; ?></td>
                                                <td><?php echo $finalRatings[$i + 3]['name']; ?></td>
                                                <td><?php echo $finalRatings[$i + 4]['name']; ?></td>



                                            </tr>

                                            <?php
                                            $i = $i + 5;
                                        }
                                        ?>

                                    </tbody>
                                </table>

                            </div>
                        <?php } ?>
                    </form>

                </div>
            </div>
        </div>
    </div>

    <br>


</div>
<!-- /#page-wrapper -->
<script>
    $(document).ready(function() {
        $('#final-ratings').dataTable(
                {
                    'columns': []
                });
    });
</script>

<?php include_once(dirname(__FILE__) . '/../general/footer.php'); ?>